//生产总览组件(测试阶段)
import React, { Component } from "react";
import { connect } from "dva";
import {
    List,
    WhiteSpace,
    Picker,
    DatePicker,
    WingBlank
} from "antd-mobile";
import styles from "./ProHistory.less";
import ProHistoryTu from "../Echarts/ProHistoryTu";
const seasons = [
    {
        label: "运行数据",
        value: "运行数据",
        children: [
            {
                value: "进料土壤含水率",
                label: "进料土壤含水率"
            }, {
                value: "处理量",
                label: "处理量"
            }, {
                value: "物料粒径",
                label: "物料粒径"
            }, {
                value: "天然气压力",
                label: "天然气压力"
            }, {
                value: "天然气消耗量",
                label: "天然气消耗量"
            }, {
                value: "空气流量",
                label: "空气流量"
            }, {
                value: "窑尾温度",
                label: "窑尾温度"
            }, {
                value: "高温氧化器温度",
                label: "高温氧化器温度"
            }, {
                value: "换热器热风进出口温度",
                label: "换热器热风进出口温度"
            }, {
                value: "换热器空气进出口温度",
                label: "换热器空气进出口温度"
            }, {
                value: "窑体压力",
                label: "窑体压力"
            }, {
                value: "急冷塔进出口温度",
                label: "急冷塔进出口温度"
            }, {
                value: "布袋除尘器进出口压力",
                label: "布袋除尘器进出口压力"
            }, {
                value: "循环泵压力",
                label: "循环泵压力"
            }, {
                value: "循环泵流量",
                label: "循环泵流量"
            }, {
                value: "pH值",
                label: "pH值"
            }, {
                value: "压缩空气压力",
                label: "压缩空气压力"
            }
        ]
    },
    {
        label: "环保数据",
        value: "环保数据",
        children: [
            {
                value: "一氧化碳",
                label: "一氧化碳"
            },
            {
                value: "颗粒物",
                label: "颗粒物"
            }, {
                value: "氮氧化物",
                label: "氮氧化物"
            }, {
                value: "氯化氢",
                label: "氯化氢"
            }, {
                value: "水处理量",
                label: "水处理量"
            }, {
                value: "COD",
                label: "COD"
            }, {
                value: "pH值",
                label: "pH值"
            }
        ]
    }
];
const seasons1 = [
    [{
        label: "运行数据",
        value: "运行数据",
    },{
        label: "环保数据",
        value: "环保数据",
    }],
   
];
class ProHistory extends Component {
    state = {
        visible: false,
        sValue: [],
        sValue1: [],
        date: null,
        date1: null
    };

  onePicker = (date,v) => {
      console.log(date,v)
      this.setState({
          [date]:v
      })
  }
  save = (v) => {
    this.setState({
        sValue:v
    })
  }

    render() {
        const { cities } = this.state;
        console.log(this.state.sValue)
        console.log(this.state.date)
        return (
            <WingBlank>
                <WhiteSpace />
                <div className={styles.containerTop}>
                    <WhiteSpace />
                
                    <Picker
                        data={seasons}
                        title="测点名称"
                        cascade={true}
                        extra="请选择(可选)"
                        value={this.state.sValue}
                        onChange={this.save}
                        onOk={this.save}
                        cols={2}
                       
                    >
                        <List.Item arrow="horizontal">数据类型</List.Item>
                    </Picker>

                    <WhiteSpace style={{borderBottom:"1px solid rgba(175, 186, 236, 0.43)",marginLeft:'15px',marginRight:'15px'}}/>
                    <DatePicker
                        value={this.state.date}
                        onChange={this.onePicker.bind(this,'date')}
                        maxLength={130}
                    >
                        <List.Item arrow="horizontal">开始时间</List.Item>
                    </DatePicker>
                    <WhiteSpace style={{borderBottom:"1px solid rgba(175, 186, 236, 0.43)",marginLeft:'15px',marginRight:'15px'}}/>
                    <DatePicker
                        value={this.state.date1}
                        onChange={this.onePicker.bind(this,'date1')}
                        maxLength={130}
                    >
                        <List.Item arrow="horizontal">结束时间</List.Item>
                    </DatePicker>
                  

                </div>
                <WhiteSpace />
                <div className={styles.containerBottom}>
                    <ProHistoryTu />
                </div>
                <WhiteSpace />
            </WingBlank>
        );
    }
}
function mapStateToProps(state) {
    return {};
}
export default connect()(ProHistory);
